home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group01b.txt / 000015_icon-group-sender _Mon Jul 24 11:36:42 2000.msg < prev    next >
Internet Message Format  |  2002-01-03  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id LAA12054
  4.     for icon-group-addresses; Mon, 24 Jul 2000 11:36:34 -0700 (MST)
  5. Message-Id: <200007241836.LAA12054@baskerville.CS.Arizona.EDU>
  6. Date: Mon, 24 Jul 2000 10:48:44 -0700
  7. From: Steve Wampler <swampler@noao.edu>
  8. X-Accept-Language: en
  9. To: icon-group <icon-group@optima.CS.Arizona.EDU>
  10. Subject: deepImage that handles empty lists...
  11. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  12. Status: RO
  13. Content-Length: 689
  14.  
  15.  
  16. I just noticed that deepImage() doesn't handle empty lists
  17. correctly.  Here's a fixed version...
  18.  
  19. procedure deepImage(arg)
  20.     local resultString
  21.  
  22.     if string(arg) then return string(arg)
  23.  
  24.     case type(arg) of {
  25.  
  26.         "list": {
  27.              resultString := "["
  28.              every resultString ||:= deepImage(!arg) || ","
  29.              if (resultString[-1] == ",") then {
  30.                  resultString[-1] := ""
  31.                  }
  32.              resultString ||:= "]"
  33.              return resultString
  34.              }
  35.  
  36.         default: return image(arg)      # cop out on other structures
  37.  
  38.         }
  39.  
  40. end
  41.  
  42. --
  43. Steve Wampler-  SOLIS Project, National Solar Observatory
  44. swampler@noao.edu
  45.